Skip to content

Convert JSON data to a string and check whether a string contains a specific value

Use the json_format function to convert JSON data to a string. Use the json_array_contains function to check whether a string or JSON data contains a specific element.

SQL
* |
SELECT
  json_format(json_parse('[1, 2, 3]')) as string,
  json_array_contains('[1, 2, 3]', 2),
  json_array_contains(json_parse('[1, 2, 3]'), 2)